<?php


namespace app\services;


use app\models\UserTask;

class UserTaskService extends Services {
    protected $task_id;
    protected $user_id;

    /**
     * @return mixed
     */
    public function getTaskId() {
        return $this->task_id;
    }

    /**
     * @param mixed $task_id
     */
    public function setTaskId($task_id): void {
        $this->task_id = $task_id;
    }

    /**
     * @return mixed
     */
    public function getUserId() {
        return $this->user_id;
    }

    /**
     * @param mixed $user_id
     */
    public function setUserId($user_id): void {
        $this->user_id = $user_id;
    }

    public function addUserTask() {
        $UserTask = new UserTask();
        $UserTask->user_id = $this->user_id;
        $UserTask->task_id = $this->task_id;
        $UserTask->date = date("Y-m-d");
        $UserTask->status = 1;
        $UserTask->ctime = date("Y-m-d H:i:s");
        $UserTask->utime = date("Y-m-d H:i:s");
        return $UserTask->save();
    }
}